///////////////////////////////////////////////////////////////////////
// File:        MainWinClass.cpp
// Description: 
// Author:      Philip Kommnick
// Created:     Wed September 16 15:43:14 CEST 2009
//
// This program is open source. For license terms, see the LICENSE file.
//
///////////////////////////////////////////////////////////////////////

#include "stdafx.h"

static int display = 0;

HWND MainWin::hWnd = NULL;

void MainWin::Show(bool show)
{
	if (show) {
		if (!IsWindowVisible(hWnd))
			ShowWindow(hWnd, SW_SHOW);
		display++;
	} else {
		if (IsWindowVisible(hWnd))
			ShowWindow(hWnd, SW_HIDE);
		if (--display < 0)
			throw std::exception("called hide without show");
	}
}
